package com.ruoyi.web.controller.tool;

import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.inspection.service.LocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/location")
public class LocationController {
    @Autowired
    private LocationService locationService;

    /**
     * 根据省市区获取location，location包含经纬度，用逗号连接
     * @param province
     * @param city
     * @param area
     * @return
     */
    @GetMapping("getLongitudeLatitude")
    public String getLongitudeLatitude(String province, String city, String area) {
        String address = province + city + area;
        String longitudeLatitude = locationService.getLongitudeLatitude(address);
        return longitudeLatitude;
    }
}
